const express = require('express');
const app = express()
var bodyParser = require('body-parser')
const cookieParser = require('cookie-parser');
const IndexRoute = require("./routes/index")
let port = process.env.port || "4000"

const http = require('http').createServer(app);
require("./db/socketserver")(http)


// 使用bpdy-parser解post请求的json
app.use(bodyParser.json())

app.use(cookieParser())

app.use("/", IndexRoute);
app.use("/",express.static("../gzhipin-client/build"))

http.listen(port, () => {
    console.log("server is listen " + port)
})